home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0195.ZIP / EXTENDIO.DAT < prev    next >
Text File  |  1984-12-17  |  3KB  |  63 lines

  1. {@@@@@@@@@@@@@@@@@ copyright 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@
  2.  
  3. Standard TURBO procedures for input/output do not support subdirectories.
  4.  
  5. These file handling procedures are based on the DOS 2.0 "file handle" access
  6. concept.  They are named after their standard TURBO equivalents, but with
  7. an X in front.  Note that these files are not "typed"--they are just files
  8. of bytes.  The "SIZE" parameter determines how many bytes are read at once.
  9.  
  10.     NOTE that any program that INCLUDEs these Extended I/O routines MUST
  11.     also include the type definitions in REGPACK.TYP and FILENAME.TYP,
  12.     and ERRMESSG.LIB, to interpret any error messages.
  13.  
  14.  
  15. Xreset(VAR FileName : filename_type; VAR handle : integer; VAR error : byte);
  16.     NOTE: for a simple reset of an already-open file, use XSeek.
  17. Xrewrite(VAR FileName : filename_type; VAR handle : integer; VAR error:byte);
  18.     INPUT  : a filename, including full path.
  19.     EFFECT : XRESET opens an already-existing file
  20.              XREWRITE opens a new file, or writes over an existing file
  21.     OUTPUT : an integer FILE HANDLE or a byte ERROR.
  22.  
  23.  
  24. Xclose(handle : integer ; VAR error : byte);
  25.     INPUT  : integer FILE HANDLE
  26.     EFFECT : flushes buffers and closes the file
  27.     OUTPUT : error #6 if handle is wrong
  28.  
  29. Xread(handle,size : integer ; VAR buffer ; VAR error : byte);
  30. Xwrite(handle,size : integer ; VAR buffer ; VAR error : byte);
  31.     INPUT  : integer FILE HANDLE
  32.              integer SIZE of buffer variable.  You can pass this using TURBO's
  33.              builtin SIZEOF(x) function, where x is a variable OR a TYPE.
  34.     EFFECT : reads into or writes from the buffer.
  35.     OUTPUT : byte error message
  36.  
  37. Xerase(VAR filename : filename_type ; VAR error : byte);
  38.     INPUT  : filename, including drive and full path
  39.     EFFECT : erases the named filename
  40.     OUTPUT : byte error message
  41.  
  42. Xseek(handle, offset,size : integer ;  starting_at  : char;
  43.         VAR position : integer ;  VAR error    : byte);
  44.     INPUT  : integer FILE HANDLE
  45.              integer OFFSET--how far to seek forward, in # of records
  46.              integer SIZE of each record
  47.              character STARTING_AT: [B]eginning, [E]nd, or [C]urrent position
  48.     EFFECT : moves the file pointer to a position OFFSET*SIZE bytes after
  49.              the position defined by STARTING_AT.
  50.     OUTPUT : integer POSITION--position of file pointer in # of records after
  51.              the move.
  52.              byte ERROR message.
  53.     NOTES  : OFFSET and POSITION both have the potential to be 32-bit
  54.              quantities, but since TURBO doesn't handle even true 16-bit
  55.              quantities easily, I didn't implement this possibility.  It is
  56.              probably safe to assume that if you want BIG access to BIG files,
  57.              your record size will be such that you won't have more than
  58.              32,767 records.
  59.              To APPEND to a file, XSEEK Starting_At the [E]nd for an OFFSET
  60.              of 1, SIZE of 1.  You'll need a dummy variable for the returned
  61.              POSITION.}
  62. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  63.